/**
 * @param {number[]} nums
 * @return {number}
 */
var findMaxK = function (nums) {
  let res = -1
  let set = new Set(nums)

  for (const num of nums) {
    if (set.has(0 - num)) {
      res = Math.max(res,Math.abs(num))
    }
  }
  return res
};